Optimal. Leaf size=88 \[ \frac {b^2 \tanh ^{-1}\left (\frac {\sqrt {a-b} \sin (c+d x)}{\sqrt {a}}\right )}{\sqrt {a} d (a-b)^{5/2}}-\frac {\sin ^3(c+d x)}{3 d (a-b)}+\frac {(a-2 b) \sin (c+d x)}{d (a-b)^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.12, antiderivative size = 88, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3676, 390, 208} \[ \frac {b^2 \tanh ^{-1}\left (\frac {\sqrt {a-b} \sin (c+d x)}{\sqrt {a}}\right )}{\sqrt {a} d (a-b)^{5/2}}-\frac {\sin ^3(c+d x)}{3 d (a-b)}+\frac {(a-2 b) \sin (c+d x)}{d (a-b)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 208
Rule 390
Rule 3676
Rubi steps
\begin {align*} \int \frac {\cos ^3(c+d x)}{a+b \tan ^2(c+d x)} \, dx &=\frac {\operatorname {Subst}\left (\int \frac {\left (1-x^2\right )^2}{a-(a-b) x^2} \, dx,x,\sin (c+d x)\right )}{d}\\ &=\frac {\operatorname {Subst}\left (\int \left (\frac {a-2 b}{(a-b)^2}-\frac {x^2}{a-b}+\frac {b^2}{(a-b)^2 \left (a-(a-b) x^2\right )}\right ) \, dx,x,\sin (c+d x)\right )}{d}\\ &=\frac {(a-2 b) \sin (c+d x)}{(a-b)^2 d}-\frac {\sin ^3(c+d x)}{3 (a-b) d}+\frac {b^2 \operatorname {Subst}\left (\int \frac {1}{a-(a-b) x^2} \, dx,x,\sin (c+d x)\right )}{(a-b)^2 d}\\ &=\frac {b^2 \tanh ^{-1}\left (\frac {\sqrt {a-b} \sin (c+d x)}{\sqrt {a}}\right )}{\sqrt {a} (a-b)^{5/2} d}+\frac {(a-2 b) \sin (c+d x)}{(a-b)^2 d}-\frac {\sin ^3(c+d x)}{3 (a-b) d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.51, size = 115, normalized size = 1.31 \[ \frac {\frac {6 b^2 \left (\log \left (\sqrt {a-b} \sin (c+d x)+\sqrt {a}\right )-\log \left (\sqrt {a}-\sqrt {a-b} \sin (c+d x)\right )\right )}{\sqrt {a} (a-b)^{5/2}}+\frac {3 (3 a-7 b) \sin (c+d x)}{(a-b)^2}+\frac {\sin (3 (c+d x))}{a-b}}{12 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.50, size = 276, normalized size = 3.14 \[ \left [\frac {3 \, \sqrt {a^{2} - a b} b^{2} \log \left (-\frac {{\left (a - b\right )} \cos \left (d x + c\right )^{2} - 2 \, \sqrt {a^{2} - a b} \sin \left (d x + c\right ) - 2 \, a + b}{{\left (a - b\right )} \cos \left (d x + c\right )^{2} + b}\right ) + 2 \, {\left (2 \, a^{3} - 7 \, a^{2} b + 5 \, a b^{2} + {\left (a^{3} - 2 \, a^{2} b + a b^{2}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{6 \, {\left (a^{4} - 3 \, a^{3} b + 3 \, a^{2} b^{2} - a b^{3}\right )} d}, -\frac {3 \, \sqrt {-a^{2} + a b} b^{2} \arctan \left (\frac {\sqrt {-a^{2} + a b} \sin \left (d x + c\right )}{a}\right ) - {\left (2 \, a^{3} - 7 \, a^{2} b + 5 \, a b^{2} + {\left (a^{3} - 2 \, a^{2} b + a b^{2}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{3 \, {\left (a^{4} - 3 \, a^{3} b + 3 \, a^{2} b^{2} - a b^{3}\right )} d}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 1.54, size = 161, normalized size = 1.83 \[ \frac {\frac {3 \, b^{2} \arctan \left (-\frac {a \sin \left (d x + c\right ) - b \sin \left (d x + c\right )}{\sqrt {-a^{2} + a b}}\right )}{{\left (a^{2} - 2 \, a b + b^{2}\right )} \sqrt {-a^{2} + a b}} - \frac {a^{2} \sin \left (d x + c\right )^{3} - 2 \, a b \sin \left (d x + c\right )^{3} + b^{2} \sin \left (d x + c\right )^{3} - 3 \, a^{2} \sin \left (d x + c\right ) + 9 \, a b \sin \left (d x + c\right ) - 6 \, b^{2} \sin \left (d x + c\right )}{a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}}}{3 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.80, size = 98, normalized size = 1.11 \[ \frac {-\frac {\frac {a \left (\sin ^{3}\left (d x +c \right )\right )}{3}-\frac {b \left (\sin ^{3}\left (d x +c \right )\right )}{3}-a \sin \left (d x +c \right )+2 b \sin \left (d x +c \right )}{\left (a -b \right )^{2}}+\frac {b^{2} \arctanh \left (\frac {\left (a -b \right ) \sin \left (d x +c \right )}{\sqrt {a \left (a -b \right )}}\right )}{\left (a -b \right )^{2} \sqrt {a \left (a -b \right )}}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 15.44, size = 251, normalized size = 2.85 \[ \frac {\frac {2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a-2\,b\right )}{a^2-2\,a\,b+b^2}+\frac {4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (a-4\,b\right )}{3\,\left (a^2-2\,a\,b+b^2\right )}+\frac {2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (a-2\,b\right )}{a^2-2\,a\,b+b^2}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}-\frac {b^2\,\mathrm {atan}\left (\frac {2{}\mathrm {i}\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3-6{}\mathrm {i}\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2\,b+6{}\mathrm {i}\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b^2-2{}\mathrm {i}\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^3}{\sqrt {a}\,{\left (a-b\right )}^{5/2}\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}\right )\,1{}\mathrm {i}}{\sqrt {a}\,d\,{\left (a-b\right )}^{5/2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________